import React from 'react';
import '../../../node_modules/normalize.css/normalize.css';
import DataEditingTable from "../../components/Material_UI/Table/DateEditingTable/DataEditingTable"
import Grid from '@material-ui/core/Grid'
import { withStyles } from '@material-ui/core/styles'

function showEditRow(editRow) {
    console.log(editRow)
}
function showDeleteRow(deleteRow) {
    console.log(deleteRow)
}
function showAddRow(addRow) {
    console.log(addRow)
}
function showDeleteAll(deleteAllRow) {
    console.log(deleteAllRow)
}

function showSearchRow(searchRow) {
    console.log(searchRow)
}

const styles = theme => ({

})
const App = (props)=>(
    <Grid container className={props.classes.root}>
        <Grid item>
            <DataEditingTable
                              rows={[
                                    {name: 'Cupcake',price: 1, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 2, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 3, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 4, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 5, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 6, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 7, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 8, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 9, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 10, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 11, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 12, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 13, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 14, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 15, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 16, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'},
                                    {name: 'Cupcake',price: 17, count: 3.7,age: 3.7,sex: 3.7,height: 3.7,weight: 3.7,time:'2018-12-21',like:'eat'}
                              ]}
                              page={0}
                              rowsPerPage={5}
                              rowNames={['name','price','count','age','sex','height','weight','time','like']}
                              columnNames={['姓名',"价格","数量",'年龄','Cupcake','身高','体重','时间','喜好']}
                              title={"用户信息表"}
                              hover={true}
                              editFunc={showEditRow}
                              deleteFunc={showDeleteRow}
                              addFunc={showAddRow}
                              batchDeleteFunc={showDeleteAll}
                              searchFunc={showSearchRow}
                              dateColumn={[7]}
                              timeColumn={[8]}
            >
            </DataEditingTable>
        </Grid>
    </Grid>

)
export default withStyles(styles)(App)